import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/login'
import Register from '@/views/register'
import Rukou from '@/views/rukou'
import Index from '@/views/index'
import Find from '@/views/find'
import News from '@/views/news'
import User from '@/views/user'
import Collect from '@/views/collect'
import Rent from '@/views/rent'
import CityList from '@/views/cityList'
import AddHouse from '@/views/addHouse'
import SearchRend from '@/views/searchRend'
import MapHouse from '@/views/mapHouse'
// import { component } from 'vue/types/umd'
Vue.use(VueRouter)

// const routes = [
// ]

const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: Login
    },
    {
      path: '/register',
      component: Register
    },
    {
      path: '/collect',
      component: Collect
    },
    {
      path: '/rent',
      component: Rent
    },
    {
      path: '/cityList',
      component: CityList
    },
    {
      path: '/addHouse',
      component: AddHouse
    },
    {
      path: '/searchRend',
      component: SearchRend
    },
    {
      path: '/mapHouse',
      component: MapHouse
    },
    {
      path: '/',
      component: Rukou,
      redirect: '/index',
      children: [
        {
          path: 'index',
          component: Index
        },
        {
          path: 'find',
          component: Find
        },
        {
          path: 'news',
          component: News
        },
        {
          path: 'user',
          component: User
        }
      ]
    }
  ]
})

export default router
